/**
 * 神州信息(2012)
 */
package net.abbp.report.view.cell.io;

import org.dom4j.Element;

import net.abbp.report.model.io.IValueIO;
import net.abbp.report.view.cell.value.FormulaValue;

/**
 * 公式值输入输出
 * 
 * @version 1.0
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since ABBP 1.0
 * 
 *        <pre>
 * 历史：
 *      建立: Jul 28, 2012 lexloo
 * </pre>
 */
public class FormulaValueIO implements IValueIO {

    @Override
    public Object read(Element value) {
        return new FormulaValue(value.getTextTrim());
    }

    @Override
    public void write(Element element, Object value) {
        element.addText(((FormulaValue) value).getFormula());
    }

}
